package Satellites;

import java.util.Scanner;
import java.util.Timer;
import java.util.TimerTask;

public class Tester {
	
	static int interval;
	static Timer timer;
	private static int hour;
	private static int min;
	private static int sec = 0;
	private static String correctionHour = "";
	private static String correctionMinute = "";
	private static String correctionSecond = "";

	public static void main(String[] args) {
	    Scanner sc = new Scanner(System.in);
	    System.out.print("Input seconds => : ");
	    String secs = sc.nextLine();
	    int delay = 1000;
	    int period = 1000;
	    timer = new Timer();
	    interval = Integer.parseInt(secs);
	    System.out.println(convertTime(interval));
	    timer.scheduleAtFixedRate(new TimerTask() {

	        public void run() {
	        	
	            setInterval();
	           System.out.println(convertTime(interval));
	           

	        }
	    }, delay, period);

	}
	
	
	private static final int setInterval() {

	    return --interval;
	}
	
	private static String convertTime(int num){
       if(num >=3600){
            hour = num/3600;
            min = (num%3600)/60;
            sec = (num%3600-min)/60;
            if(hour < 10) correctionHour ="0";
            else correctionHour ="";
            if(min < 10) correctionMinute="0";
            else correctionMinute="";
            if(sec < 10) correctionSecond="0";
            else correctionSecond="";
            return correctionHour + hour + ":" + correctionMinute + min + ":" + correctionSecond + sec;
          }
          else{
            if(num < 3600 && num >= 60){
              min = (num%3600)/60;
              sec = (num%3600)-(min*60);
              if(min < 10) correctionMinute="0";
              else correctionMinute="";
              if(sec < 10) correctionSecond="0";
              else correctionSecond="";
              return "00:" + correctionMinute + min + ":" + correctionSecond + sec;
            }else{
            	sec = (num%3600)-(min*60);
            	if(sec < 10) correctionSecond="0";
            	else correctionSecond="";
            	return "00:00:" + correctionSecond + sec;
            }
          }
		
	}

}
